import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  // 首页
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/index.vue')
  },

  // 登录
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/login.vue')
  },

  // 选择房间
  {
    path: '/select-room',
    name: 'SelectRoom',
    component: () => import('../views/select-room.vue'),
    meta: {
      title: '选择活动'
    }
  },

  // 赛羊
  {
    path: '/sheep-score/:roomId/:contestId/:contestName',
    name: 'SheepScore',
    component: () => import('../views/sheep-score.vue'),
    meta: {
      title: '参赛羊评分'
    }
  },

  // 羊 当前排名
  {
    path: '/sheep-rank',
    name: 'SheepRank',
    component: () => import('../views/sheep-rank.vue'),
    meta: {
      title: '查询参赛羊排名'
    }
  },

  // 剪羊毛 参赛选手
  {
    path: '/person-list/:roomId/:contestId',
    name: 'PersonList',
    component: () => import('../views/person-list.vue'),
    meta: {
      title: '剪羊毛选手'
    }
  },

  // 剪羊毛
  {
    path: '/person-score/:roomId/:contestId/:personId/:personNumber/:personName/:isScore',
    name: 'Person',
    component: () => import('../views/person-score.vue'),
    meta: {
      title: '剪羊毛选手评分'
    }
  },

  // 设置
  {
    path: '/config',
    name: 'Config',
    component: () => import('../views/config.vue'),
    meta: {
      title: '我的'
    }
  },
]

const router = new VueRouter({
  // mode: 'hash',
  routes
})

export default router
